<%--
 *  File:    PrivilegeCheckSummary.jsp
 *  @Author: youlv 
 *  Date:    2016/2/17
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.PrivilegeCheckSummary"); 
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "UPM";
  	String strTableName = "v_privilegechecksummary";
  	String privilegeCode = "Z0105";
  	String contextPath = request.getContextPath();
%>



<%
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
  	String isPrimaryAdmin = (String)CurUserInfo.get("isprimaryadmin");
  	Integer nCurUserId = (Integer)CurUserInfo.get("usergroupid");
  	if(isPrimaryAdmin == null)
  	{
    	isPrimaryAdmin = "";
  	}
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>


<html>
<head>
<title>PrivilegeCheckSummary</title>
<PageFlow:CheckPageFlow pageName="p_privilegechecksummary"/>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(frm,actionvalue,orderbyname);
  editform.action = "PrivilegeCheckSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function page_export(){
	var searchnamealias = document.frm.searchnamealias.value;
	var searchvalue = document.frm.searchvalue.value;
<%-- 	var url= "<%=reportURL%>/servlet/ExcecuteReport/PrivilegeCheckReport.sox?__format=xlsx&__folder=/ovalreport"+"&sessionid=" + "<%=session.getId()%>"; --%>
	var url= "<%= reportURL %>/csv?__report=/ovalreport/PrivilegeCheckReport.txt&zip=true";
	if(searchvalue!=null && searchvalue !=""){
		var str = searchnamealias.substr(0,searchnamealias.indexOf('^'));
		if(str=="employeecode"){
			url+="&employeecode="+searchvalue;
		}else if(str=="employeename"){
			url+="&employeename="+escape(encodeURI(searchvalue));
		}else if(str=="usergroupname"){
			url+="&usergroupname="+escape(encodeURI(searchvalue));
		}else if(str=="privlistcode"){
			url+="&privlistcode="+searchvalue;
		}else if(str=="privlistname"){
			url+="&privlistname="+escape(encodeURI(searchvalue));
		}else if(str=="privilegecode"){
			url+="&privilegecode="+searchvalue;
		}else if(str=="privilegename"){
			url+="&privilegename="+escape(encodeURI(searchvalue));
		}else if(str=="privilegecode1"){
			url+="&privilegecode1="+searchvalue;
		}else if(str=="privilegename1"){
			url+="&privilegename1="+escape(encodeURI(searchvalue));
		}else if(str=="privilegecode2"){
			url+="&privilegecode2="+searchvalue;
		}else if(str=="privilegename2"){
			url+="&privilegename2="+escape(encodeURI(searchvalue));
		}
		
	}
	var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";   
    popwindow = window.open(url, "nwindow", strstatus);
}
 
</script>

<% //--------------------------------------  output variant from pageflow --%>
<%
  	Vector userGroupSummary = (Vector)pageContext.getAttribute("ugsummary");
  	if(userGroupSummary == null)
  	{
    	userGroupSummary = new Vector();
  	}
%>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

	<% //--------------------------------------  hidden form variant --%>
	<form name="frm" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_privilegechecksummary">
    <input type="hidden" name="actionname">
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    
	<% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
	
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
  	<tr> 
    	<td valign="top"> 
    		<table width="100%" border="0" cellspacing="0">
          	<tr><td class="summary_top" ></td></tr>
        	</table>
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<%@ include file="/inc/SummarySearch.inc" %>
        	</table>
        </td>
   	</tr>
   	</table>
   
   	<table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="0">
   
   	<% //--------------------------------------  summary header --%>
   	<tr bgcolor="#ACBCCA"  class="deepblue-left" > 
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','employeecode')"><%= label.getLabelName("L_EmployeeCode1") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','employeename')"><%= label.getLabelName("L_EmplyeeName") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','usergroupname')"><%= label.getLabelName("L_UserGroup") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','privlistcode')"><%= label.getLabelName("L_PrivListCode") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','privlistname')"><%= label.getLabelName("L_PrivListName") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','privilegecode')"><%= label.getLabelName("L_PrivilegeCode") %></a></td>
       	<td width="10%" class="title_center" ><a href="javascript:page_summary('orderby','privilegename')"><%= label.getLabelName("L_PrivilegeName") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','privilegecode1')"><%= label.getLabelName("L_ParentPrivilegeCode") %></a></td>
       	<td width="10%" class="title_center" ><a href="javascript:page_summary('orderby','privilegename1')"><%= label.getLabelName("L_ParentPrivilegeName") %></a></td>
       	<td width="8%" class="title_center" ><a href="javascript:page_summary('orderby','privilegecode2')"><%= label.getLabelName("L_SuperPrivilegeCode") %></a></td>
       	<td width="10%" class="title_center" ><a href="javascript:page_summary('orderby','privilegename2')"><%= label.getLabelName("L_SuperPrivilegeName") %></a></td>
    </tr>

	<% //--------------------------------------  default value definition --%>
    <%
        Integer nDefaultUserGroupId = new Integer(-1);               
        String strClassType = new String(); 
        boolean bHasChecked = false;
        String strDefaultIsDisabled="";
        String strDefaultUserGroupName=""; 
   	%>
   	
    <% //--------------------------------------  loop results --%>
    <logic:iterate id="usergroup" collection="<%= userGroupSummary %>" indexId="orderId">                      
    	
    <%
    	HashMap userGroupMap = (HashMap)pageContext.getAttribute("usergroup"); 
        
        if((orderId.intValue())%2 == 1){
        	strClassType = "td-listrom";             
        }else{                    
            strClassType = "none";
        }
        
  	%>
    
    <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" class="<%=JspHelper.filterNull( strClassType )%>">
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("employeecode") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("employeename") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("usergroupname") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privlistcode") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privlistname") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegecode") )%></td>
        <td width="10%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegename") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegecode1") )%></td>
        <td width="10%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegename1") )%></td>
        <td width="8%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegecode2") )%></td>
        <td width="10%" class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( userGroupMap.get("privilegename2") )%></td>
    </tr>
    </logic:iterate>  
    
    <% //--------------------------------------  default value --%>       
    
        
    <% //--------------------------------------  flipping page --%>
    <%@ include file="/inc/SummaryAction.inc" %>
    </table>
    
    <% //--------------------------------------  page operation button --%>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    	<tr> 
        	<td class="summary_top" ></td>
        </tr>
        <tr> 
        	<td class="td_center"> 
        	    <%if(pageContext.getAttribute("ugsummary")!=null){%>
        		<a onclick="page_export()"><custom:button type="1" label="L_Execcd" imgsrc="delete.gif" border="0" style="width:60" /></a>    
        		<%} %>    		
        	</td>
        </tr>
  	</table>
   	</td>
</tr>
</table>
</form>
</body>
</html>


